package com.zg.job.config;

import org.springframework.batch.core.configuration.JobRegistry;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.batch.core.configuration.support.MapJobRegistry;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.batch.core.launch.support.SimpleJobLauncher;
import org.springframework.batch.core.repository.JobRepository;

/**
 * <p>Description: </p>
 *
 * @author zhanfeng.liang
 * @since 2025/2/20 9:18
 */

@Configuration
@EnableBatchProcessing
public class BatchConfig {


//    @Bean
//    public JobLauncher jobLauncher() throws Exception {
//        SimpleJobLauncher jobLauncher = new SimpleJobLauncher();
//        jobLauncher.setTaskExecutor(new SimpleAsyncTaskExecutor()); // 异步执行
//        jobLauncher.afterPropertiesSet();
//        return jobLauncher;
//    }
}